//
//  LGFriendLingyuanViewController.m
//  ligenyun
//
//  Created by Mac on 2018/4/10.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//

#import "LGFriendDaoWenViewController.h"
#import "LGDaoWenTableViewCell.h"
@interface LGFriendDaoWenViewController ()
@property(nonatomic, strong) NSMutableArray                     *dataSouce;
@end

@implementation LGFriendDaoWenViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"ta的悼文";
    self.tableView.st_noreslutView = [[STNoresultView alloc] initWithFrame:CGRectMake(0, 100, UIScreenWidth, 400) title:@"暂无悼文" buttonTitle:@"" buttonHandle:^(NSString *titleString) {
        
    }];
    self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        [self sendHisLingyuanRequest];
    }];
    [self.tableView.mj_header beginRefreshing];
    // Do any additional setup after loading the view.
}
#pragma --mark UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    
    return self.dataSouce.count;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return [LGDaoWenTableViewCell cellHeight];
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    
    return 10;
}
- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    return [UIView new];
}
- (UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    return [UIView new];
}
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString * reuseIdentifier =  @"cell";
    LGDaoWenTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:reuseIdentifier];
    if (!cell) {
        cell = [[LGDaoWenTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
        
    }
    return cell;
}
#pragma --mark UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    [self.tableView deselectRowAtIndexPath:indexPath animated:NO];
}

#pragma mark --NetWork Method
- (void)sendHisLingyuanRequest{
    [TMUtils debugSimulationNetWorkWithHadle:^(NSInteger afterTime) {
        self.dataSouce = [@[@"",@"",@"",@"",@"",@"",@"",@""] mutableCopy];
        [self.tableView.mj_header endRefreshing];
        [self.tableView reloadData];
    }];
}
@end


